package com.example.xuecheng.systemservice.controller;

import com.example.xuecheng.systemservice.service.impl.DictionaryServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import po.Dictionary;

import java.util.List;

/**
 * @author xiehaidong
 */
@RestController
@Api(description = "数据字典查询接口")
public class DictionaryController {
    @Autowired
    private DictionaryServiceImpl dictionaryService;

    @GetMapping("/dictionary/all")
    @ApiOperation("查询所有数据字典")
    public List<Dictionary> queryAll(){
        return dictionaryService.queryAll();
    }
    @GetMapping("/dictionary/code/{code}")
    @ApiOperation("查询数据字典详细信息")
    public Dictionary getByCode(@PathVariable(value = "code")String code){
        return dictionaryService.getByCode(code);
    }


}
